<?php /*a:1:{s:58:"/www/wwwroot/mod1.idhx.top/tp/view/admin/user/userone.html";i:1711267424;}*/ ?>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>menu</title>
    <link rel="stylesheet" href="/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuimini/css/public.css" media="all">
    <style>
        .layui-btn:not(.layui-btn-lg):not(.layui-btn-sm):not(.layui-btn-xs) {
            height: 34px;
            line-height: 34px;
            padding: 0 8px;
        }
    </style>
</head>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <div>
                <fieldset class="table-search-fieldset">
                    <form action="" class="layui-form">
                        <div class="layui-form-item">
                            <div class="layui-inline">用户头像:</div>
                            <div class="layui-inline">
                                <img class="layui-upload-img" src="<?php echo htmlentities($one['headimg']); ?>" style="height:100%;width:auto">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">用户昵称:</div>
                            <div class="layui-inline">
                                <?php echo htmlentities($one['nickname']); ?>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">用户身份:</div>
                            <div class="layui-inline">
                                <?php echo htmlentities($one['identity']); ?>
                            </div>
                        </div>
                    </form>
                </fieldset>
                <table id="topiclog-list" class="layui-table" lay-filter="topiclog-list"></table>
                <script type="text/html" id="status">
                <input type="checkbox"  {{ d.status == '1' ? 'checked' : '' }} id="{{d.id}}" name="status" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                </script>
                <script type="text/html" id="isred">
                    <input type="checkbox"  {{ d.isred == '1' ? 'checked' : '' }} id="{{d.id}}" name="isred" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                    </script>
                <script type="text/html" id="isphone">
                        <input type="checkbox"  {{ d.isphone == '1' ? 'checked' : '' }} id="{{d.id}}" name="isphone" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                        </script>
            </div>
        </div>
    </div>
    <!-- 操作列 -->
    <script type="text/html" id="auth-state">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="info">详情</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

    <script src="/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="/layuimini/js/lay-config.js?1" charset="utf-8"></script>
    <script>
        layui.use(['table', 'form'], function () {
            var $ = layui.jquery;
            var table = layui.table;
            var form = layui.form;

            // 创建渲染实例
            table.render({
                elem: '#topiclog-list'
                , url: '/User/topiclog' // 此处为静态模拟数据，实际使用时需换成真实接口
                ,where:{'user_id':<?php echo htmlentities($one['id']); ?>}
                // , toolbar: '#toolbarDemo'
                // , defaultToolbar: false
                , page: true
                , cols: [[
                    // {
                    //     field: 'headimg', width: 100, title: '头像', templet: function (res) {
                    //         return '<img class="layui-upload-img"  src="' + res.headimg + '" style="height:100%;width:auto">'
                    //     }
                    // }
                    // , { field: 'nickname', title: '昵称' }
                    { field: 'naire_title', title: '问卷标题' }
                    , { field: 'inTime', title: '问卷时间' }
                    , { title: '操作', toolbar: '#auth-state' }
                ]]
                , done: function () {
                    var id = this.id;

                }
                , error: function (res, msg) {
                    console.log(res, msg)
                }
            });

            form.on('radio', function (data) {
                console.log(data.value)
                return false;
            });

            //监听工具条
            table.on('tool(topiclog-list)', function (obj) {
                var data = obj.data;
                var layEvent = obj.event;
                if (layEvent === 'del') {
                    var id = data.id
                    layer.msg('确定删除此记录？', {
                        time: 10000, //10s后自动关闭
                        btn: ['确定', '取消'],
                        btn1: function () {
                            $.ajax({
                                type: "post",
                                url: "/Naire/delNaireLog",
                                data: { id: id },
                                dataType: "json",
                                success: function (res) {
                                    layer.msg(res.msg)
                                    if (res.code == 1) {
                                        table.reload('topiclog-list');
                                    }
                                }
                            });
                        },


                    });

                } else if (layEvent === 'info') {
                    var index = layer.open({
                        title: '问卷详情',
                        type: 2,
                        shade: 0.2,
                        maxmin: true,
                        shadeClose: true,
                        area: ['60%', '100%'],
                        content: '/Naire/topicLogInfo?id=' + data.id,
                        end: function () {
                            table.reload('topiclog-list');
                        }
                    });
                }
            });



        });
    </script>
</body>

</html>